import axios from '@/libs/api.request'
import cookie from "vux/src/tools/cookie";

//获取需求分类列表
export const getDemandCategory = () => {
  return axios.request({
    url: 'UserDemand/getDemandCategory',
    method: 'post',
  })
}
//获取用户需求列表
export const getUserDemandList = (cid) =>{
  return axios.request({
    url:'UserDemand/getUserDemandList',
    data:{cid},
    method: 'post',
  })
}
//获取需求列表
export const getDemandList = (demandCategoryId) =>{
  return axios.request({
    url:'UserDemand/getUserDemandDetail',
    data:{demandCategoryId},
    method: 'post',
  })
}
//需求详情
export const getUserDemandDetail =( id ) =>{
  return axios.request({
    url:'UserDemand/getUserDemandDetail',
    data:{id},
    method: 'post',
  })
}
//发布需求
export const addUserDemand = ({cid,demandCategoryId,content,budget,province,city,mobile,invoiceType})=>{
  const data={
    cid,
    demandCategoryId,
    content,
    budget,
    province,
    city,
    mobile,
    invoiceType,
  }
  return axios.request({
    url:'UserDemand/addUserDemand',
    data,
    method: 'post',
  })
}
